const path = require('path');

function resolve(dir) {
    return path.join(__dirname, dir);
}
module.exports = {
    configureWebpack: {
        resolve: {
            alias: {
                //添加vue别名
                'vue$': 'vue/dist/vue.esm.js',
            }
        },
        devServer: {
            proxy: {
                '/data5': {
                    target: 'http://www.bjlink32.com/data5.php?cateID=10001',
                    ws: true,
                    changeOrigin: true,
                    pathRewrite: {
                        '^/data5': ''
                    }
                },
                '/data6': {
                    target: 'http://www.bjlink32.com/data6.php?cateID=10002',
                    ws: true,
                    changeOrigin: true,
                    pathRewrite: {
                        '^/data6': ''
                    }
                }
            }
        },
    },
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@style', resolve('src/assets/style'))
            .set('@assets', resolve('src/assets'))
            .set('@common', resolve('src/common'))
        // 这里只写了两个个，你可以自己再加，按这种格式.set('', resolve(''))
    }

}